/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Telas;

import Classes.Carteirinha;
import Controles.FuncionarioDAO;
import Controles.Tabela;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

/**
 *
 * @author dayan
 */
public class Carteirinhas extends javax.swing.JFrame {
    
    
    Tabela tmCarteirinhas = new Tabela(null, new String[] {"ID", "Nome Estudante", "Dt. Emissão", "Dt. Validade"});
    ListSelectionModel lsmCarteirinhas;
    List<Carteirinha> carteirinhas;
    
    
    
    /**
     * Creates new form Carteirinhas
     */
    public Carteirinhas() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        tfPesquisa = new javax.swing.JTextField();
        btPesquisar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbCarteirinhas = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        tfNome = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        tfInstituicao = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        tfCurso = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        tfDataValidade = new javax.swing.JFormattedTextField();
        tfDataEmissao = new javax.swing.JFormattedTextField();
        btSalvar = new javax.swing.JButton();
        btRevalidar = new javax.swing.JButton();
        btCancelar = new javax.swing.JButton();
        btFechar = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        menuSobre = new javax.swing.JMenuItem();
        menuSair = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Carteirinhas");

        btPesquisar.setText("Pesquisar");
        btPesquisar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btPesquisarActionPerformed(evt);
            }
        });

        tbCarteirinhas.setModel(tmCarteirinhas);
        tbCarteirinhas.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        lsmCarteirinhas = tbCarteirinhas.getSelectionModel();
        lsmCarteirinhas.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e){
                if(! e.getValueIsAdjusting()){
                    tbCarteirinhasLinhaSelecionada(tbCarteirinhas);
                }
            }
        });

        tbCarteirinhas.getColumnModel().getColumn(0).setPreferredWidth(50);
        tbCarteirinhas.getColumnModel().getColumn(1).setPreferredWidth(200);
        tbCarteirinhas.getColumnModel().getColumn(2).setPreferredWidth(100);
        tbCarteirinhas.getColumnModel().getColumn(3).setPreferredWidth(100);
        tbCarteirinhas.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
        jScrollPane1.setViewportView(tbCarteirinhas);

        jLabel1.setText("Nome:");

        tfNome.setEditable(false);

        jLabel2.setText("Instituição de Ensino: *");

        tfInstituicao.setEditable(false);

        jLabel3.setText("Curso: *");

        tfCurso.setEditable(false);

        jLabel4.setText("Data de Emissão: *");

        jLabel5.setText("Data de Validade: *");

        tfDataValidade.setEditable(false);
        try {
            tfDataValidade.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        tfDataEmissao.setEditable(false);
        try {
            tfDataEmissao.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("##/##/####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }

        btSalvar.setText("Salvar");
        btSalvar.setEnabled(false);
        btSalvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSalvarActionPerformed(evt);
            }
        });

        btRevalidar.setText("Revalidar");
        btRevalidar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btRevalidarActionPerformed(evt);
            }
        });

        btCancelar.setText("Cancelar");
        btCancelar.setEnabled(false);
        btCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btCancelarActionPerformed(evt);
            }
        });

        btFechar.setText("Fechar");
        btFechar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btFecharActionPerformed(evt);
            }
        });

        jLabel6.setText("*: Campos com preencimento obrigatório!");

        jMenu1.setText("Opções");

        menuSobre.setText("Sobre");
        menuSobre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuSobreActionPerformed(evt);
            }
        });
        jMenu1.add(menuSobre);

        menuSair.setText("Sair");
        menuSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                menuSairActionPerformed(evt);
            }
        });
        jMenu1.add(menuSair);

        jMenuBar1.add(jMenu1);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(tfCurso)
                                    .addComponent(jLabel3))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(tfDataEmissao, javax.swing.GroupLayout.DEFAULT_SIZE, 127, Short.MAX_VALUE)
                                .addGap(55, 55, 55)))
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jLabel2)
                                        .addGap(0, 0, Short.MAX_VALUE))
                                    .addComponent(tfInstituicao))
                                .addContainerGap())
                            .addGroup(layout.createSequentialGroup()
                                .addGap(58, 58, 58)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel5)
                                    .addComponent(tfDataValidade, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(tfNome)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 462, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(tfPesquisa)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(btPesquisar))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel1)
                                    .addComponent(jLabel4))
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(btSalvar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btRevalidar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btCancelar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(btFechar)
                        .addGap(62, 62, 62))))
            .addGroup(layout.createSequentialGroup()
                .addComponent(jLabel6)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btCancelar, btFechar, btPesquisar, btRevalidar, btSalvar});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfPesquisa, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btPesquisar))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(tfNome, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfCurso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfInstituicao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tfDataValidade, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfDataEmissao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btSalvar)
                    .addComponent(btRevalidar)
                    .addComponent(btCancelar)
                    .addComponent(btFechar))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btRevalidarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btRevalidarActionPerformed
        alteraCarteirinha();
    }//GEN-LAST:event_btRevalidarActionPerformed

    private void btCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btCancelarActionPerformed
        revalidaCarteirinha();
        desabilitaCampos();
    }//GEN-LAST:event_btCancelarActionPerformed
    
    private void btPesquisarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btPesquisarActionPerformed
       listarCarteirinhas();
    }//GEN-LAST:event_btPesquisarActionPerformed

    private void menuSobreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuSobreActionPerformed
        JOptionPane.showMessageDialog(null, "Sistema de Emissão de Carteirinhas v1.0 desenvolvido por: \nDayan Costa\nIury Rezende"
                + "\nLuciano Costa\nVitor Almeida");
    }//GEN-LAST:event_menuSobreActionPerformed

    private void menuSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_menuSairActionPerformed
        if (JOptionPane.showConfirmDialog(null, "Esta ação irá sair do sistema por completo, confirma esta ação?", "ATENÇÃO!", JOptionPane.YES_NO_OPTION) == 0) {
            System.exit(0);
        }
    }//GEN-LAST:event_menuSairActionPerformed

    private void btFecharActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btFecharActionPerformed
        if (JOptionPane.showConfirmDialog(null, "Deseja sair da tela de Carteirinhas?", "ATENÇÃO!", JOptionPane.YES_NO_OPTION) == 0) {
            this.dispose();
        }
        revalidaCarteirinha();
        desabilitaCampos();
        tbCarteirinhas.getSelectionModel().clearSelection(); //limpa a tabela
    }//GEN-LAST:event_btFecharActionPerformed

    private void btSalvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSalvarActionPerformed
        modificaCarteirinha();
    }//GEN-LAST:event_btSalvarActionPerformed

    private void habilitaCampos(){
        tfDataValidade.setEditable(true);
        btSalvar.setEnabled(true);
        btFechar.setEnabled(false);
        btRevalidar.setEnabled(false);
        btCancelar.setEnabled(true);
        
    }
    private void desabilitaCampos(){
        tfDataValidade.setEditable(false);
        tfDataEmissao.setEditable(false);
        btSalvar.setEnabled(false);
        btFechar.setEnabled(true);
        btRevalidar.setEnabled(true);
        btCancelar.setEnabled(false);
    }
    private void revalidaCarteirinha(){
        habilitaCampos();
        tfDataValidade.setText("");
    }
    
    
    public boolean validarData(String dataVencimento){
        Date data = null;
        
        String dataTexto = new String(dataVencimento);
        SimpleDateFormat formatoData = new SimpleDateFormat("dd/MM/yyyy");
        try{
            formatoData.setLenient(false);
            data = formatoData.parse(dataTexto);
            return true;
        } catch(ParseException e){
            JOptionPane.showMessageDialog(null, "Data de Validade Inválida. Digite uma data Válida!", "Aviso", JOptionPane.WARNING_MESSAGE);
            tfDataValidade.requestFocus();
            return false;
        }
    }
    private boolean verificaData(){
        if((!tfDataValidade.getText().trim().equals(""))){
            return true;
        } else{
            JOptionPane.showMessageDialog(null, "Data inválida!!");
            tfDataValidade.requestFocus();
            return false;
        }
    }
    private void alteraCarteirinha(){
        if(tbCarteirinhas.getSelectedRow() != -1){
            habilitaCampos();
        } else{
            JOptionPane.showMessageDialog(null, "Selecione uma carteirinha na tabela!");
        }
    }
    public boolean compararDatas(String data1, String data2){
        Date emissao = null;
        Date validade = null;
        
        String newDate1 = new String(data1);
        String newDate2 = new String(data2);
        SimpleDateFormat formatoData = new SimpleDateFormat("dd/MM/yyyy");
        
        try{
            formatoData.setLenient(false);
            emissao = formatoData.parse(data1);
            validade = formatoData.parse(data2);
            if(emissao.before(validade)){
                return true;
            } else {
                tfDataValidade.requestFocus();
                JOptionPane.showMessageDialog(null, "Data de Validade deverá ser maior que a Data de Emissão!");
                return false;
            } 
                        
        } catch(ParseException e){
            System.out.println(e);
            return false;
        }
    }
    private void modificaCarteirinha(){
        if(verificaData() && validarData(tfDataValidade.getText().trim())){
            try {
                Carteirinha carteirinha = new Carteirinha();
                
                carteirinha.setDataValidade(tfDataValidade.getText().trim());
                carteirinha.setId(carteirinhas.get(tbCarteirinhas.getSelectedRow()).getId());
                
                
                if(compararDatas(tfDataEmissao.getText().trim(), tfDataValidade.getText().trim())){
                    FuncionarioDAO dao = new FuncionarioDAO();
                    dao.revalidaCarteirinha(carteirinha);
                    JOptionPane.showMessageDialog(null, "Data de validade alterada com sucesso!");
                    desabilitaCampos();
                } else{
                    habilitaCampos();
                }
            } catch (SQLException ex) {
                Logger.getLogger(Carteirinhas.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }
    private void tbCarteirinhasLinhaSelecionada(JTable table){
        if(tbCarteirinhas.getSelectedRow() != -1){
            tfNome.setText(carteirinhas.get(table.getSelectedRow()).getEstudante().getNome());
            tfInstituicao.setText(carteirinhas.get(table.getSelectedRow()).getEstudante().getInstituicaoDeEnsino());
            tfCurso.setText(carteirinhas.get(table.getSelectedRow()).getEstudante().getCurso());
            tfDataEmissao.setText(carteirinhas.get(table.getSelectedRow()).getDataEmissao());
            tfDataValidade.setText(carteirinhas.get(table.getSelectedRow()).getDataValidade());
        }
    }
    private void listarCarteirinhas(){
        try {
            FuncionarioDAO dao = new FuncionarioDAO();
            carteirinhas = dao.listarCarteirinhas("%" + tfPesquisa.getText().trim() + "%");
            mostrarCarteirinhas(carteirinhas);
        } catch (SQLException ex) {
            Logger.getLogger(Carteirinhas.class.getName()).log(Level.SEVERE, null, ex);
        }
        
    }
    private void mostrarCarteirinhas(List<Carteirinha> carteirinhas){
        while(tmCarteirinhas.getRowCount() > 0){
            tmCarteirinhas.removeRow(0);
        } if(carteirinhas.isEmpty()){
            JOptionPane.showMessageDialog(null, "Nenhuma carteirinha encontrada!");
        } else{
            String [] linha = new String[]{null, null, null, null};
            for(int i = 0; i < carteirinhas.size(); i++){
                
                    tmCarteirinhas.addRow(linha);
                    tmCarteirinhas.setValueAt(carteirinhas.get(i).getId(), i, 0);
                    tmCarteirinhas.setValueAt(carteirinhas.get(i).getEstudante().getNome(), i, 1);
                    tmCarteirinhas.setValueAt(carteirinhas.get(i).getDataEmissao(), i, 2);
                    tmCarteirinhas.setValueAt(carteirinhas.get(i).getDataValidade(), i, 3);
                
            }
        }
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Carteirinhas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Carteirinhas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Carteirinhas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Carteirinhas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Carteirinhas().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btCancelar;
    private javax.swing.JButton btFechar;
    private javax.swing.JButton btPesquisar;
    private javax.swing.JButton btRevalidar;
    private javax.swing.JButton btSalvar;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JMenuItem menuSair;
    private javax.swing.JMenuItem menuSobre;
    private javax.swing.JTable tbCarteirinhas;
    private javax.swing.JTextField tfCurso;
    private javax.swing.JFormattedTextField tfDataEmissao;
    private javax.swing.JFormattedTextField tfDataValidade;
    private javax.swing.JTextField tfInstituicao;
    private javax.swing.JTextField tfNome;
    private javax.swing.JTextField tfPesquisa;
    // End of variables declaration//GEN-END:variables
}
